/*
 * Collection.h
 *
 *  Created on: 2012-5-17
 *      Author: esf
 */

#ifndef COLLECTION_H_
#define COLLECTION_H_

#include "Iterable.h"
#include "../../java.lang/headfiles/Object.h"

namespace collection {
template<class E>
class Collection: public virtual collection::Iterable<E> {
public:
	virtual int size()=0;
	virtual bool isEmpty()=0;
	virtual bool contains(Object &o)=0;
	virtual Iterator<E> iterator()=0;
	virtual Object* toArray()=0;
	virtual bool add(E&e)=0;
	virtual bool remove(E&e)=0;
	virtual bool containsAll(Collection<E>&c)=0;
	/**
	 * 仅保留Collection中的元素，其余去除
	 */
	virtual bool retainAll(Collection<E>&c)=0;
	virtual ~Collection() {
	}

};

} /* namespace collection */
#endif /* COLLECTION_H_ */
